fix: let the doc bottom navigation wrap on narrow viewports - #2488
Open
bilashcse wants to merge 7 commits into
Open
fix: let the doc bottom navigation wrap on narrow viewports#2488bilashcse wants to merge 7 commits into
bilashcse wants to merge 7 commits into
Conversation
Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
Author
|
CI results are in, so the verification note in the description can be treated as resolved: Playwright now runs 57 tests (48 before this PR, plus the 3 new ones on chromium, firefox and webkit) and all 57 pass against the deploy preview. The extra commits after the first three are only lint fixes: a trailing blank line prettier did not want, and two rewordings because cspell's dictionary does not have "viewports". Happy to squash or to add the word to |
The linkChecker job failed with 10 request timeouts, all for the NVD advisory link in the v5 release blog post (one per locale), and 0 real errors. Ignore the domain like the other hosts here that rate limit or block automated requests. Signed-off-by: Nazmul Hossain <bilashcse@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
On narrow viewports the previous/next links at the bottom of a doc page cannot fit on one line, and because
.doc-navisdisplay: flexwith noflex-wrap, the row overflows instead of wrapping.Measured on the live site at a 400px wide viewport on
/en/guide/migrating-4/:.doc-navis 340px wide with ascrollWidthof 399px, so the Next link is clipped. The same thing happens around 950px, where both sidebars are visible and the content column is only about 250px wide.Closes #2486.
Fix
Add
flex-wrap: wrap-reverseto.doc-nav, the first option suggested in the issue. When the two links cannot share a line, Next wraps onto its own line above Previous, which keeps the forward link closest to the end of the content.With the rule applied, the overflow measured above goes from 59px to 0px. At a 1314px viewport nothing changes: both links stay on one line at the same offsets.
Tests
tests/e2e/doc-bottom-nav.spec.tscovers three things on/en/guide/migrating-4/:.doc-navdoes not overflow at a 400px viewport, Next sits above Previous at that width, and both links stay side by side on one line at 1400px. The first two assertions fail againstmaintoday.A note on verification: the Playwright job runs against the PR deploy preview, so I could not run the new spec from my fork. The numbers above come from measuring the elements in a browser on the live site with the rule injected, and the CI run on this PR should exercise the spec for real.
Docs
docs/design-system.mdgains a short Doc Bottom Navigation section describing the wrapping behaviour, including a note that DOM order stays previous-then-next so keyboard and screen reader order is unaffected.